import { HTTP } from '../utils/http.js'

class CartHttp extends HTTP {
  // 获取购物车商品数量
  getMyCartSum () {
    return this.request({
      url: 's/yddgoods/GetMyCartSum',
      method: 'POST',
    })
  }
  // 获取购物车商品
  YddMyCartGet () {
    return this.request({
      url: 's/yddgoods/YddMyCartGet',
      method: 'POST',
    })
  }
  // 删除购物车数据
  YddMyCartDel (data) {
    return this.request({
      url: 's/yddgoods/YddMyCartDel',
      method: 'POST',
      data:data
    })
  }
  // 计算商品优惠
  goodsDiscount (data) {
    return this.request({
      url: 'order/discount',
      method: 'POST',
      data:data,
      isJavaRequest:true
    })
  }
  //检验支付密码
  verifyPayPassword(data){
    return this.request({
      url: 's/userinfo/VerifyPayPassword',
      method: 'POST',
      data:data
    })
  }
  //创建订单
  createOrder(data) {
    return this.request({
      url: 'order/createOrder',
      method: 'POST',
      data: data,
      isJavaRequest: true
    })
  }
  //创建秒杀订单
  createRushOrder(data) {
    return this.request({
      url: 'order/createRushOrder',
      method: 'POST',
      data: data,
      isJavaRequest: true
    })
  }
}

export { CartHttp }
